<%
  var colid = 0;
  var childid = 0;
  var col;
  if(isNotEmpty(column_id)){
    colid = parseInt(column_id);
  }
  if(isNotEmpty(child_column_id)){
    childid = parseInt(child_column_id);
  }
  if(isNotEmpty(column)){
    col = column;
  }
%>
<header class='am-topbar am-topbar-fixed-top ${colid!=0?"am-topbar-inverse"}'>
  <div class="am-container">
    <h1 class="am-topbar-brand">
      <a href="#">JBase框架</a>
    </h1>

    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-secondary am-show-sm-only"
            data-am-collapse="{target: '#collapse-head'}"><span class="am-sr-only">导航切换</span> <span
        class="am-icon-bars"></span></button>


    <div class="am-collapse am-topbar-collapse" id="collapse-head">
      <ul class="am-nav am-nav-pills am-topbar-nav">
        <li ${colid==0?:"class='am-active'"}><a href="${BASE}/index">首页</a></li>
        <% 
          var menulist = cmsfn.columnWithChilds();
          for(var menu in menulist){
            if(1==menu.showChild && isNotEmpty(menu.childList)){
            var childList = menu.childList;
        %>
        <li class='am-dropdown ${colid==menu.id?:"am-active"}' data-am-dropdown>
          <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;"> ${menu.name} <span class="am-icon-caret-down"></span></a>
          <ul class="am-dropdown-content">
            <% for(var cmenu in childList){ %>
            <li ${childid==cmenu.id?:"class='am-active'"}><a href="${BASE}/column/${cmenu.id}">${cmenu.name}</a></li>
            <% } %>
          </ul>
        </li>
        <%  }else{ %>
        <li ${colid==menu.id?:"class='am-active'"}><a href="${BASE}/column/${menu.id}">${menu.name}</a></li>
        <%
            }
          }
        %>
      </ul>

      <div class="am-topbar-right">
      <form class="am-topbar-form am-topbar-left am-form-inline" role="search">
        <div class="am-input-group am-input-group-sm am-input-group-secondary">
          <input type="text" class="am-form-field" placeholder="搜索">
          <span class="am-input-group-btn">
            <button class="am-btn am-btn-secondary" type="button"><span class="am-icon-search"></span></button>
          </span>
        </div>
      </form>
      </div>
    </div>
  </div>
</header>